 /*
 * Config.h
 *
 *  Created on: 7 июн. 2022 г.
 *      Author: nikita
 */

#ifndef SRC_TECHNICAL_CONFIG_H_
#define SRC_TECHNICAL_CONFIG_H_

#include "../STL_includes.h"
#include "../Typedefs.h"
#include "../Math_stuff/CurrentOptions.h"
#include "../Static_classes/SemanticAnalyzer/SemanticAnalyzer.h"
#include "../TerminalMainClass.h"

namespace STC_calc
{
/*
*	The Config class is a singleton allows
* working with configs.
*/
class Config
{
private:
	static std::list<std::shared_ptr<CurrentOptions>> options_list;
	static std::shared_ptr<CurrentOptions> current;
	Config();
	~Config();
	static std::string program_location;

public:

	static std::string get_program_location(){return program_location;}

    static void next_configs(const CurrentOptions::Modes mode = CurrentOptions::mode_standart_function, const std::string& execution_str = "", const string_vector& flags_up = {});
	static void next_configs(const std::shared_ptr<CurrentOptions> confs);
	static void back_configs();

    static void add_variable(const string_list& args);
    static void add_variable(const std::shared_ptr<MVariable> var);
    static void add_variable(const std::string& name, const long double min, const long double max, const long double steps = 1000);

    static void add_constant(const string_list& args);
    static void add_constant(const std::shared_ptr<MConstant> var);
    static void add_constant(const std::string& name, const long double value);

    static void set_mode(const Modes mode);

    static std::shared_ptr<MVariable> get_variable(const std::string& name);
    static bool is_var(const std::string& name);
    static std::shared_ptr<MConstant> get_constant(const std::string& name);
    static bool is_const(const std::string& name);

	static void set_location(const std::string& args);
	static bool is_flag(const std::string& flag_name);
    static void add_flag(const std::string& flag_name);
};

} /* namespace STC_calc */

#endif /* SRC_TECHNICAL_CONFIG_H_ */
